package com.czy.workflow.core.executor;

import com.czy.workflow.core.context.FlowContext;
import com.czy.workflow.core.exception.FlowException;
import com.czy.workflow.core.model.TaskInfo;

/**
 * 任务执行接口
 */
public interface TaskExecutor extends Runnable{

    boolean startTask(TaskInfo taskInfo) throws FlowException;

    boolean finishTask(TaskInfo taskInfo) throws FlowException;

    boolean execute(TaskInfo taskInfo) throws FlowException;

    boolean execute(String docId, String nodeId, String option) throws FlowException;

    boolean suspendTask(TaskInfo taskInfo) throws FlowException;

    boolean recoveryTask(TaskInfo taskInfo) throws FlowException;

    void setFlowContext(FlowContext flowContext);

}
